package com.qf.mxapp.controller;


import com.qf.mxapp.pojo.Product;
import com.qf.mxapp.result.ApiStatus;
import com.qf.mxapp.result.ResponseData;
import com.qf.mxapp.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("products")
public class ProductController {
    @Resource
    private ProductService productService;

    @GetMapping("/recommend/{bId}")
    public ResponseData<List> recommendProduct(@PathVariable Integer bId){
        List<Product> productList = productService.getRecommendByBusinessId(bId);
        return  new ResponseData<>(ApiStatus.SUCCESS,productList);
    }
}
